package com.jintu.portal.pojo.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.jintu.portal.utils.SpringContextUtil;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by liyou on 2017/9/29.
 */
public class NoticeListDto implements Serializable {

    /**
     * 公告id
     */
    private Long noticeId;

    /**
     * 公告发布时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    private Date startTime;

    /**
     * 标题
     */
    private String title;

    /**
     * 封面
     */
    private String imgUrl;

    private String linkUrl;

    private String rootUrl = SpringContextUtil.getPropertiesValue("root_url");

    public NoticeListDto(Long noticeId, Date startTime, String title, String imgUrl, Integer type) {
        this.noticeId = noticeId;
        this.startTime = startTime;
        this.title = title;
        this.imgUrl = imgUrl;
        if(type == 1) {//系统通知
            this.linkUrl = rootUrl+"/mobile/notice/sysNotice?noticeId="+noticeId;
        }else {
            this.linkUrl = rootUrl+"/mobile/notice/companyNotice?noticeId="+noticeId;
        }
    }

    public Long getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(Long noticeId) {
        this.noticeId = noticeId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }
}
